<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */
/* @var $form CActiveForm */
?>

<div class="form">

<?php echo "<?php \$form=\$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl(\$this->route),
)); ?>\n"; ?>

	<table>
		<tr>
			<td width="15%"><?php echo "<?php echo \$form->label(\$model,'id'); ?>"; ?></td>
			<td width="35%"><?php echo "<?php echo \$form->textField(\$model,'id'); ?>"; ?></td>
			
			<td width="15%"><?php echo "<?php echo \$form->label(\$model,'TODO'); ?>"; ?></td>
			<td width="35%"><?php echo "<?php echo \$form->textField(\$model,'TODO'); ?>"; ?></td>
		</tr>

<?php foreach($this->tableSchema->columns as $column): ?>
<?php
	$field=$this->generateInputField($this->modelClass,$column);
	if(strpos($field,'password')!==false || in_array($column->name, array('id')))
		continue;
	else if(in_array($column->name, array('create_time', 'update_time')))
	{
?>
		<tr>
			<td><?php echo "<?php echo \$form->label(\$model,'".$column->name."'); ?>"; ?></td>
			<td colspan="3">
				<?php echo "<?php \$this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => \$model,
					'attribute'=>'".$column->name."_from',
					'options'=>array(
						'dateFormat' => 'yy/mm/dd'
					),
					'htmlOptions'=>array('size'=>'10')
				)); ?>\n"; ?>
				00:00:00 ~
				<?php echo "<?php \$this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => \$model,
					'attribute'=>'".$column->name."_to',
					'options'=>array(
						'dateFormat' => 'yy/mm/dd'
					),
					'htmlOptions'=>array('size'=>'10')
				)); ?>\n"; ?>
				23:59:59
				
				<?php echo "<?php echo \$form->error(\$model,'".$column->name."'); ?>\n"; ?>
			</td>
		</tr>
<?php } else if(in_array($column->name, array('visible', 'del_flg'))) { ?>
		<tr>
			<td><?php echo "<?php echo \$form->label(\$model,'{$column->name}'); ?>"; ?></td>
			<td colspan="3"><?php echo "<?php echo \$form->checkBoxList(\$model,'".$column->name."', Yii::app()->params['ArrVisible'], array('labelOptions'=>array('style'=>'display:inline', 'class'=>'prm'), 'separator' => '')); ?>"; ?></td>
		</tr>
<?php } else { ?>
		<tr>
			<td><?php echo "<?php echo \$form->label(\$model,'{$column->name}'); ?>"; ?></td>
			<td colspan="3"><?php echo "<?php echo ".$this->generateActiveField($this->modelClass,$column)."; ?>"; ?></td>
		</tr>
<?php } ?>

<?php endforeach; ?>

	</table>

	<div class="row buttons">
		<?php echo "<?php echo CHtml::submitButton('Search'); ?>\n"; ?>
	</div>

<?php echo "<?php \$this->endWidget(); ?>\n"; ?>

</div><!-- search-form -->